

<template>
  <h4>vant组件</h4>
  <van-button type="primary" @click="testLogin">点击测试</van-button>
  <van-button type="success">成功按钮</van-button>
  <van-button type="default">默认按钮</van-button>
  <van-button type="warning">警告按钮</van-button>
  <van-button type="danger">危险按钮</van-button>
  <hr>

  <div>
    <h5>pinia测试</h5>
    <h5>
      {{ userStore.msg }}------{{ userStore.count }}----{{ userStore.tel }}
    </h5>
    <button @click="handleClick">点击发送100</button>
    <button @click="addCount1">count++</button>     
     <p>pinia 的getters:{{ userStore.doubleCount }}</p>
  </div>


  <hr>
  <Test></Test>
</template>

<script setup lang="ts">

import Test from '@/test.vue'

import { useUserStore } from "@/store/useStore"
import { getLogin } from './api/user.js'


const testLogin = async () => {
  let res = await getLogin({ loginname: 'admin', password: '123456' })
  console.log(res,333333);
}

const userStore = useUserStore()

const handleClick = () => {
  userStore.setTel(100)
}

const addCount1 = () => {
  userStore.addCount()
}
</script>
<style scoped></style>